/*
 * @Description: 静态路由
 * @Author: DHL
 * @Date: 2021-12-07 11:58:19
 * @LastEditors: DHL
 * @LastEditTime: 2023-01-11 09:09:15
 */

import { RouteRecordRaw } from 'vue-router'
import Layout from '/@/layout/index.vue'

/**
 * 登录
 */
const LoginRoute: RouteRecordRaw = {
  path: '/login',
  name: 'Login',
  component: () => import('/@/pages/login/index.vue'),
  meta: {
    title: '登录',
    unauth: true
  }
}

/**
 * 重定向
 */
const RedirectRoute: RouteRecordRaw = {
  path: '/redirect',
  name: 'redirect',
  component: Layout,
  meta: { hidden: true },
  children: [
    {
      path: '/redirect/:path(.*)',
      component: () => import('/@/pages/redirect/index.vue'),
      meta: { title: 'redirect', unauth: true }
    }
  ]
}

/**
 * 主路由
 */
export const LayoutRoute: RouteRecordRaw = {
  path: '/',
  name: 'Home',
  redirect: '/dashboard',
  component: Layout,
  meta: {},
  children: [
    {
      name: 'Dashboard',
      path: 'dashboard',
      component: () => import('/@/pages/home/index.vue'),
      meta: {
        title: '首页',
        affix: true
      }
    },
    {
      name: 'CodeGenConfig',
      path: 'codeGenConfig',
      component: () => import('/@/pages/systemTools/codeGen/form.vue'),
      meta: {
        title: '代码生成配置',
        isCache: true
      }
    },
    {
      name: 'flowDesigner',
      path: 'flowDesigner',
      component: () => import('/@/pages/flow/actReModel/designer.vue'),
      meta: {
        title: '流程设计器',
        isCache: false
      }
    }
  ]
}

export const basicRoutes = [LoginRoute, RedirectRoute, LayoutRoute]
